<template>
  <div class="mui-numbox" data-numbox-min="1" style="height:25px">
    <button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
    <input id="test num_box" class="mui-input-numbox" type="number" v-model="initcount" ref="numbox" @change="countChange" />
    <button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
  </div>
</template>
<script>
import mui from "../../lib/mui/js/mui.min.js";
export default {

  mounted() {
    mui(".mui-numbox").numbox();
  },
  methods:{
    countChange(){
      // console.log(this.$refs.numbox.value)
      this.$store.commit('updataGoodsCount',{
        id:parseInt(this.goodsid),
        count:this.$refs.numbox.value
      })
    }
  },
  props:["initcount","goodsid"]
};
</script>